from selenium.webdriver.common.by import By
from selenium import webdriver
import time
from Po.Base import Base

class Page5(Base):
    sousuo_loc = (By.ID, 'wd')

    def sousuo(self):
        self.send_keys(self.sousuo_loc, '五粮液')

    sousuobtn_loc = (By.XPATH, '/html/body/div[4]/div/div[2]/div[1]/form/input[2]')

    def sousuobtn(self):
        self.click(self.sousuobtn_loc)

    spxq_loc = (By.XPATH, '/html/body/div[6]/div/div[2]/div[5]/ul/li[1]/div[2]/div[1]/a/img')

    def spxq(self):
        self.click(self.spxq_loc)

    shoucang_loc = (By.XPATH, '/html/body/div[5]/div[2]/div[1]/div[3]/div[2]/div[1]/a/i')

    def shoucang(self):
        self.click(self.shoucang_loc)

    def luoji_jiuxiannn(self):
        self.open_url('https://login.jiuxian.com/')
        self.sousuo()
        self.sousuobtn()
        time.sleep(5)
        self.spxq()
        self.shoucang()